import React, { useEffect, useState } from 'react'
import api from '../../api'
import styles from "./hospitalAnnouncementDesc.module.scss"
import { useParams } from "react-router-dom"
import { Divider } from 'antd-mobile'
export default function hospitalAnnouncementDesc() {
    const params = useParams()
    const [info, setInfo] = useState({})
    function getHospitalAnnouncementInfo() {
        api.getHospitalAnnouncementInfo(params).then(res => {
            setInfo(res.info)
        })
    }
    useEffect(() => {
        getHospitalAnnouncementInfo()
    }, [])
    return (
        <div className={styles.content}>
            <div className={styles.title}>{info.title}</div>
            <div className={styles.user}>
                <span>创建时间：{info.createTime}</span>
                <span>创建人：{info.username}</span>
            </div>
            <img src={info.image}></img>
            <Divider></Divider>
            <div dangerouslySetInnerHTML={{ __html: info.content }}></div>
        </div>
    )
}
